// import { compose, curry } from "/nodeRmodules/lodash.js";
// import $ from "/nodeRmodules/jquery.js";

const trace = R.curry((tag, x) => {
  console.log(tag);
  return x;
});

const setHtml = R.curry((sel, html) => $(sel).html(html));
const getJSON = (url) => {
  console.log(url);
  fetch(url)
    .then((response) => response.json())
    .then((res) => console.log("res", res))
    .catch((err) => console.err(err));
};

const url = (word) =>
  "http://fanyi.youdao.com/translate?&doctype=json&type=AUTO&i=" +
  encodeURIComponent(word);

var app = R.compose(getJSON, url);
app("cat");
